<template>
  <div>
    <el-dialog
      :title="this.$t('ReservoirRegionLang.warehouse_goods')"
      :visible.sync="Visible"
      width="1000px"
      :close-on-click-modal="false"
      @close="cancel"
    >
      <div class="midContant clearfix">
        <div class="dialogBox top">
          <MyTable
          :tableColumn="tableColumn"
          :tableData="tableData"
          :isOrder="false"
          >
            <template v-slot:content="scope">
              <span>{{ scope.row[scope.config.prop] }}</span>
            </template>
          </MyTable>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button  type="primary" @click="confirm" size="small"
          >{{$t('common.confirm')}}</el-button
        >
        <el-button  @click="cancel" size="small">{{$t('common.cancel')}}</el-button>
      </span>
      
    </el-dialog>
  </div>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      Visible: false,
      code:'',
      tableColumn: [
        {
          checked: true,
          label: this.$t('ReservoirRegionLang.customer'),
          prop: "name_current",
          width:100,
        },
        {
          checked: true,
          label: this.$t('ReservoirRegionLang.box_no'),
          prop: "name_current",
          width:100,
        },
        {
          checked: true,
          label: this.$t('ReservoirRegionLang.SKU'),
          prop: "name_current",
          width:100,
        },
        {
          checked: true,
          label: this.$t('ReservoirRegionLang.cases'),
          prop: "name_current",
          width:100,
        },
        {
          checked: true,
          label: this.$t('ReservoirRegionLang.long'),
          prop: "name_current",
          width:100,
        },
        {
          checked: true,
          label: this.$t('ReservoirRegionLang.wide'),
          prop: "name_current",
          width:100,
        },
        {
          checked: true,
          label: this.$t('ReservoirRegionLang.tall'),
          prop: "name_current",
          width:100,
        },
        {
          checked: true,
          label: this.$t('ReservoirRegionLang.volum'),
          prop: "name_current",
          width:100,
        },
        {
          checked: true,
          label: this.$t('ReservoirRegionLang.quantity'),
          prop: "name_current",
          width:100,
        },
        
      ],
      tableData: [],
      confirmTrue:true,//确定按钮保护
    };
  },
  created() {
    
  },
  mounted() {
  },
  deactivated(){
    
  },
  watch: {
  },
  methods: {
   
    init(code) {
      this.code = code;
      this.Visible = true;
    },
    // 获取表格数据
    getTableData(url){
      this.$get(url).then((res) => {
        this.tableData = res.data;
      });
    },
    // 提交修改
    confirm() {
      // 是否有空值必选项标识
      if (this.confirmTrue) {
        this.confirmTrue=false
        this.$emit("success",this.tableData,this.typeStr);
        this.cancel()
        window.setTimeout(()=>{
          this.confirmTrue=true
        },1000)
      }
    },
    //取消修改
    cancel() {
      this.Visible = false;
    },
  },
};
</script>

<style scoped lang="less" >
  .midContant {
    border: 0;
    width: 100%;
  }
  .dialogBox .dialogBoxItem {
    flex-wrap: wrap;
    gap: 1%;
    justify-content: flex-start;
    .dialogBoxItemRow {
      width: 24%;
    }
  }
  /deep/.el-dialog__wrapper .el-dialog{
    min-width: unset !important;
  }
</style>